#! /usr/bin/env python
import waflib.Options
from waf_dynamo import dmsdk_add_files, apidoc_extract_task

def configure(conf):
    pass

def build(bld):
    resource = bld.stlib(features = 'cxx ddf',
                         includes = '.',
                         source = 'gui.cpp gui_script.cpp',
                         target = 'gui')

    resource = bld.stlib(features = 'cxx ddf',
                         includes = '.',
                         source = 'gui_null.cpp',
                         target = 'gui_null')

    if not waflib.Options.options.skip_build_tests:
        bld.recurse('test')

    # the dmsdk_add_files needs to be after a build group for some reason
    dmsdk_add_files(bld, '${PREFIX}/sdk/include/dmsdk', 'dmsdk')

    bld.install_files('${PREFIX}/include/gui', 'gui.h')
    bld.install_files('${PREFIX}/include/gui', 'gui_script.h')

    apidoc_extract_task(bld, ['gui_script.cpp'])
